<!DOCTYPE html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title></title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>
      * {
        margin: 0;
        padding: 0;
      }
      .nav {
        padding-top: 0.5rem;
        padding-left: 0.4rem;
      }
      .nav img {
        width: 1rem;
        height: 1rem;
      }
    </style>
  </head>
  <body>
    <div class="nav" id="center" style="display: none;">
      <img src="./camera.png" alt="Camera">
    </div>
  </body>
  <script>
    !function (w) {
      var e = w.document,
        t = e.documentElement,
        i = 750,
        o = "orientationchange" in w ? "orientationchange" : "resize",
        a = function () {
          var cw = t.clientWidth || document.body.clientWidth;
          t.style.fontSize = cw / i * 100 / 0.187 + "px"
        };
      e.addEventListener && (w.addEventListener(o, a, !1), e.addEventListener("DOMContentLoaded", a, !1));
      e.body.style.fontSize = '0.28rem';
    }(window);
    apiready = function () {
      window.api.addEventListener({
        name: 'chatDataEvent',
      }, function (ret) {
        console.log('receipt form chatDataEvent:' + JSON.stringify(ret))
        if (ret) {
          if (ret.value.didConnect) {
            document.getElementById('center').style.display = 'block'
          }
        }
      })
      document.getElementById('center').onclick = function () {
        window.api.sendEvent({
          name: 'chatEvent',
          extra: {
            type: 'camera'
          }
        })
      }
    }
  </script>
</html>
